package com.woniu.elderly.serve.feignclient;

import com.woniu.common.dto.ServeAuditDTO;
import com.woniu.common.dto.ServePersonDTO;
import com.woniu.common.dto.ServeWorkOrderDTO;
import com.woniu.common.dto.WaresDTO;
import com.woniu.common.entity.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@FeignClient(value = "elderly-wares"/*, fallback = 降级方法实现类*/)
public interface ElderlyWaresFeign {
    @GetMapping("/category/")
    Result<List<WaresCategory>> category_getCategories();

    @GetMapping("/category/{cid}")
    Result<WaresCategory> category_getCategory(@PathVariable("cid") Integer cid);

    @PostMapping("/picture/")
    Result<String> picture_upload( MultipartFile file);

    @GetMapping("/waresSku/{pageIndex}/{pageSize}")
    Result<List<WaresDTO>> waresSku_getWaresSku(@PathVariable("pageIndex") Integer pageIndex, @PathVariable("pageSize") Integer pageSize);

    @GetMapping("/waresSku/random")
    Result<List<WaresDTO>> waresSku_getRecommend();

    @PostMapping("/waresSku/")
    Result<Void> waresSku_addWaresSku(@RequestBody WaresDTO waresSku);

    @GetMapping("/wares/spu/{cid}/{pageSize}/{pageIndex}")
    Result wares_spu_getWaresSpuByCid(@PathVariable("cid") Integer cid, @PathVariable("pageSize") Integer pageSize, @PathVariable("pageIndex") Integer pageIndex);

    @GetMapping("/wares/spu/{sid}")
    Result wares_spu_getWaresSpuDTO(@PathVariable("sid") Integer sid);


}
